// fenxiao/myAllCity/index.js
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    PCList: [],
    RegionId: 0,
  },

  changeCity: function(e){
    let regionId = e.currentTarget.dataset.regionid;
    let city = e.currentTarget.dataset.city;
    wx.redirectTo({
      url: '../jjkData/index?regionId=' + regionId + '&city=' + city,
    })
  },

  getCityBoss: function () {
    let that = this;
    wx.request({
      url: app.globalData.host + '/api/distributor/GetDisRegionList?uid=' + app.globalData.userInfo.Uid,
      success: function (res) {
        if (res.data.Code == 0) {
          if (res.data.Data && res.data.Data.length > 0) {
            let PCList = res.data.Data;
            that.setData({
              PCList: PCList
            })
          }
        }
      },
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getCityBoss();
    if(options.regionId){
      this.setData({
        RegionId: options.regionId
      })
    }
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})